//
//  NSMAssetBrowserController.m
//  BSProject
//
//  Created by nsm on 2019/11/25.
//  Copyright © 2019 beisheng. All rights reserved.
//

#import "NSMAssetBrowserController.h"

@interface NSMAssetBrowserController () <NSMAssetBrowserDelegate>

@end

@implementation NSMAssetBrowserController
@synthesize assetBrowserView = _assetBrowserView;

#pragma mark - lifeCycle
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [_assetBrowserView.collectionView reloadData];
    [_assetBrowserView.collectionView layoutIfNeeded];
}

#pragma mark - override

#pragma mark - initialization
- (void)viewDidLoad {
    [super viewDidLoad];
    
    _assetBrowserView = [[NSMAssetBrowserView alloc] initWithFrame:self.view.bounds];
    _assetBrowserView.delegate = self;
    [self.view addSubview:_assetBrowserView];
}

#pragma mark - NSMAssetBrowserDelegate
- (NSInteger)numberOfItemsInAssetBrowserView:(NSMAssetBrowserView *)assetBrowserView {
    return 3;
}

#pragma mark - setter/getter
- (NSMAssetBrowserView *)assetBrowserView {
    [self loadViewIfNeeded];
    return _assetBrowserView;
}

#pragma mark - network

#pragma mark - method/public

#pragma mark - method/private

#pragma mark - action

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
